package main

import (
	"os"
	"bufio"
	"io"
)

func main(){
	filePath1 := "../1.txt"
	filePath2 := "../2.txt"
	file1,_ := os.Open(filePath1)
	file2,_ := os.OpenFile(filePath2,os.O_WRONLY | os.O_TRUNC,0666)
	defer file1.Close()
	defer file2.Close()
	reader := bufio.NewReader(file1)
	writer := bufio.NewWriter(file2)
	line := ""
	var err error
	for {
		line,err = reader.ReadString('\n')
		writer.WriteString(line)
		if err == io.EOF{
			break
		}
	}
	writer.Flush()
}
